﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace Web.admin
{
    public partial class Login :System.Web.UI.Page
    {
        //Web.UI.ManagePage managePage = new UI.ManagePage();
        //BLL.UserInformation userinfor = new BLL.UserInformation();
        //DbCommon.DbHelper dbhelper = new DbCommon.DbHelper();
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        /// <summary>
        /// 登录按钮点击事件
        /// </summary>
        /// <param name="sender">对象</param>
        /// <param name="e">参数</param>
        //protected void Check(object sender, EventArgs e)
        //{
        //    string usm = userName.Value;
        //    string pwd = password.Value;
        //    if (checkCode.Value.ToString().ToLower() == Session["CheckCode"].ToString().ToLower())
        //    {
        //        if (!string.IsNullOrEmpty(usm) && !string.IsNullOrEmpty(pwd))
        //        {
        //            if (userinfor.checkUser(usm, FormsAuthentication.HashPasswordForStoringInConfigFile(pwd.Trim(), "MD5")))
        //            {
        //                if ((bool)dbhelper.GetSingleItem("UserInformation", "UfIsLock", "UfUserName = '" + usm + "'") == false)
        //                {
        //                    //获得该用户的管理权限
        //                    Session["AdminPermission"] = dbhelper.GetSingleItem("UserInformation", "UfClassId", "UfUserName = '" + usm + "'").ToString();
        //                    string manageClass = dbhelper.GetSingleItem("UserClass", "UserTitle", "UserId=" + Session["AdminPermission"]).ToString();
        //                    Session["AdminType"] = manageClass;
        //                    int i = managePage.SaveLog(usm, "【登入状态】登入成功", manageClass);
        //                    if (i > 0)
        //                    {
        //                        Session["AdminName"] = usm;
        //                        Response.Redirect("index.aspx");

        //                    }
        //                    else
        //                        lbWarn.InnerHtml = "<span>日志存入异常</span>";
        //                }
        //                else
        //                    lbWarn.InnerHtml = "<span>该用户被禁用，请联系网站管理员</span>";
        //            }
        //            else
        //            {
        //                lbWarn.InnerHtml = "<span>用户名或密码错误</span>";
        //            }
        //        }

        //    }
        //    else
        //    {
        //        lbWarn.InnerHtml = "<span>验证码不正确</span>";
        //        return;
        //    }
        //}
    }
}